<template>
	<view class="flex-col page">
		<view class="flex-col flex-auto section_3">
			<view class="flex-col group space-y-23" v-for="(item,index) in content.list" :key="index">
				<view class="flex-row justify-between items-baseline">
					<text class="font_3">提现到微信</text>
					<text class="font_2">-{{item.amounts}}</text>
				</view>
				<view class="flex-row justify-between items-baseline group_2">
					<view class="group_3">
						<text class="font_4">{{item.create_time}}</text>
					</view>
					<text class="font_4 text_4" v-if="item.withdraw_status=='PROCESSING'">转账中</text>
					<text class="font_4 text_4" v-if="item.withdraw_status=='FAIL'">转账失败</text>
					<text class="font_5" v-else>转账成功</text>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script setup>
	import {
		onShow,
		onLoad,
		onReachBottom
	} from "@dcloudio/uni-app";
	import {
		onMounted,
		ref,
		reactive,
		getCurrentInstance
	} from "vue"
	const {
		proxy
	} = getCurrentInstance()
	let token = ref('')
	let p = ref(1)
	let content = ref({
		list: [],
	})
	onShow(() => {
		content.value.list.length = 0
		p.value = 1
		// getDate()
		getlist()
	})
	onReachBottom(() => {
		p.value++
		getlist()
	})
	const getlist = () => {
		// let trend = content.value.trend == 1 ? 'PW_BALANCE_INCOME' : content.value.trend == 2 ? 'PW_BALANCE_WD' : ''
		proxy.$req.requestPOST(proxy.$api.CenterInfo.withdrawLog, {
			member_id:uni.getStorageSync('member_id'),
			p:p.value
		}).then(res => {
			console.log(res);
			content.value.list = [...content.value.list, ...res.data.list]
			// console.log(content.value.list);
		})
	}
</script>

<style scoped lang="scss">
	.page {
		background-color: #ffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;

		.section_3 {
			padding: 4rpx 28rpx 8rpx;
			background-color: #ffffff;
			overflow-y: auto;

			.group {
				padding-bottom: 32rpx;
				
				padding-top: 32rpx;
				border-bottom: solid 2rpx #f7f7f7;
			}

			.space-y-23 {

				&>view:not(:first-child),
				&>text:not(:first-child),
				&>image:not(:first-child) {
					margin-top: 23rpx;
				}
			}

			.group_4 {
				border-bottom: solid 2rpx #f7f7f7;

				.group_5 {
					padding: 38rpx 0 32rpx;
					border-bottom: solid 2rpx #f7f7f7;
				}

				.group_6 {
					padding: 38rpx 0 32rpx;
				}
			}

			.font_3 {
				font-size: 28rpx;
				font-family: PingFang SC;
				line-height: 27rpx;
				font-weight: 500;
				color: #333333;
			}

			.font_2 {
				font-size: 36rpx;
				font-family: PingFang SC;
				line-height: 28rpx;
				font-weight: 500;
				color: #333333;
			}

			.group_2 {
				padding-left: 3rpx;

				.group_3 {
					line-height: 18rpx;
					height: 18rpx;
				}

				.font_4 {
					font-size: 22rpx;
					font-family: PingFang SC;
					line-height: 18rpx;
					color: #999999;
				}

				.text_4 {
					line-height: 21rpx;
				}

				.font_5 {
					font-size: 22rpx;
					font-family: PingFang SC;
					line-height: 21rpx;
					color: #ff3c2e;
				}
			}
		}
	}
</style>